package mylittleinvestigations.CaseInformation;

import java.util.ArrayList;

public class CaseParsingEventProvider
{
    private static ArrayList<CaseParsingEventListener> listenerList = new ArrayList<CaseParsingEventListener>();
    
    public static void RegisterListener(CaseParsingEventListener listener)
    {
        if (!listenerList.contains(listener))
        {
            listenerList.add(listener);
        }
    }
    
    public static void ClearListener(CaseParsingEventListener listener)
    {
        listenerList.remove(listener);
    }
    
    public static void RaiseCaseParsingComplete(String caseFileName)
    {
        for (int i = 0; i < listenerList.size(); i++)
        {
            listenerList.get(i).OnCaseParsingComplete(caseFileName);
        }
    }
}
